/* Papastefanos Serafeim */
/* Sunarthseis gia elegxo tupwn */

#ifndef _TYPECHK_H
#define _TYPECHK_H

#include "client.h"

/* Oi epomenes sunarthseis pernoun ws parametro ena string (kai duo ej
 * autwn pairnoun kai ena integer pou ka9orizei to megisto mege9os) kai
 * ejetazoun an sto string auto uparxei o katallhlos tupos pou fainetai
 * apo to onoma, dhladh string, int, unsignedInt, boolean, dateTime kai
 * base64. Epistrefetai 0 an sto string uparxei o katallhlos tupos kai
 * arnhtikh timh an den uparxei. */
int checkString(char *buf, unsigned int len);
int checkInt(char *buf);
int checkUnsignedInt(char *buf);
int checkBoolean(char *buf);
int checkDateTime(char *buf);
int checkBase64(char *buf, unsigned  int len);

/* Oi epomenes sunarthseis kanoun parse to string kai epistrefoun
 * ton katallhlo tupo. */
long int parseInt(char *buf);
unsigned long int parseUnsignedInt(char *buf);
int parseBoolean(char *buf);
DateTime parseDateTime(char *buf);

/* Auth h sunarthsh kaleitai prin klh9ei h handleSetParameterValues, wste
 * na elex9ei to an oi parametroi pou perniountai einai oi swstes. */
int checkSetParameterValues(ParameterValueList *parameterList, int *errors);

#endif //_TYPECHK_H
